/*
 * @Description: 角色管理接口
 */
import request from '@/utils/request'
// import request from "@/api/axios-threeline";
let organizationNo = sessionStorage.getItem("organizationNo")
export default {
  /**
   * @description: 获取设备名称列表 *代表必填
   * @param {String/Number} page *
   * @param {String/Number} size *
   * @param {Object} entity {componyId: 1} *
   * @param {String} order 排序方式 ASC DESC 默认ASC
   * @param {String} sort 自定义排序方式 'createTime'
   * @return {Array}
   */
  // 分页查询获取列表信息
  getPageList(params) {
    params.entity.organizationNo = organizationNo
    return request.post("v3/authority/v1/role/queryHome", params);
  },
  /**
   * @description: 添加add,删除delList,修改成本信息edit
   * @param {Object} params *
   * @return {Object}
   */
  allmetInfo(params, met) {
    params.organizationNo = sessionStorage.organizationNo
    return request.post(`v3/authority/v1/role/${met}`, params);
  },
  /**
   * @description: 查询当前角色功能
   * @param {Object} params *
   * @return {Object}
   */
  getfuncauth(met) {
    return request.get(`v3/authority/v1/function/getRoleFunction?roleNo=${met}`);
  },
  /**
   * @description: 添加当前角色功能
   * @param {Object} params *
   * @return {Object}
   */
  addfuncauth(params) {
    return request.post(`v3/authority/v1/role/bindFunction`, params);
  },
  /**
   * @description: 查询当前角色功能权限
   * @param {Object} params *
   * @return {Object}
   */
  getRoleFunctionTree(met) {
    return request.get(`v3/authority/v1/function/getRoleFunctionTree?roleNo=${met}`);
  }

};
